1. Field of the Invention
The present invention relates to a rewritable ROM file device and, more specifically, to a rewritable ROM file device using an EPROM (erasable programmable read-only memory), an EEPROM (electrically erasable programmable read-only memory), or the like as a storage medium.
2. Description of the Related Art
In conventional information processing, a magnetic disk device such as a floppy disk device or a hard disk device is used as a file device. However, in recent years, with the spread of portable information processing apparatuses such as a notebook-type personal computer, rewritable ROMs such as an EPROM and an EEPROM have come to be used as a file device.
An operating system (OS) secures a certain management area in a file device to manage files stored in the file device. For example, in MS-DOS (registered trademark of Microsoft Corporation), which is a standard OS of portable information processing apparatus, files stored in a file device are managed by using a table called a file allocation table (FAT). Referring to FIG. 1, the whole file device is divided into units called clusters, which are given numbers in order from the head cluster. Data of a FAT 2 correspond to the respective clusters. The FAT 2 indicates in what order the respective clusters are used. A directory 1 indicates the number of a cluster where the head data of each file is stored.
To find out where file A, for instance, is stored in the file device 3, first the directory 1 is referred to, that is, cluster numbers 12 indicating head clusters of respective files having file names 11 are checked. As a result, a head cluster position "002" of file A is obtained. Then, to find out the position of the second cluster, address "002" of the FAT 2 is referred to. As a result, the second cluster position "003" is obtained. Similarly, the next cluster position "004" is obtained by referring to address "003" of the FAT 2. If "FFF" is found in the FAT 2, it means the end of file A. For clusters not in use, "000" is stored in the FAT 2.
The FAT 2 is subjected to rewriting at each occurrence of writing to a file, which means that a particular area of the file device 3 is frequently subjected to rewriting.
However, a rewritable count of data onto a rewritable ROM is limited. For example, it is said that under the existing techniques of an EEPROM a rewritable count of data is 10.sup.4 to 10.sup.5. Therefore, if rewriting occurs frequently on a particular area such as a FAT, the life of an EEPROM is extremely shortened.
Further, in an EEPROM, since rewriting is performed on a block basis where blocks have a predetermined size, data of the entire block needs to be rewritten to rewrite only a part of the entire data. For example, data of 64 Kbytes needs to be rewritten to rewrite data of only 1 byte, which causes a slow down of the file access.
Conventionally, for example, U.S. Pat. No. 5,379,262 of Okamoto et al. granted on Jan. 3, 1995 discloses a technique for solving the above problems. This technique prevents concentration of write operations on a particular memory area by writing data to a plurality of memory areas of an EEPROM in a uni-directionally circulated manner. This conventional technique avoids an imbalance in the numbers of rewrite operations on the memory areas by moving data that is stored in the same location for a long time without being changed. Further, this technique prevents concentration of write operations on a particular area by hierarchically storing pointers which indicate positions of a table that is used to manage files.
However, in the above conventional technique, it is cumbersome to manage the operation of constantly moving storage locations of files. Further, to access the table for file management, it is necessary to trace pointers hierarchically. This may increase the access time.